package com.scoutmobmap.client;

import java.util.Date;

import com.google.gwt.maps.client.geom.LatLng;
import com.google.gwt.maps.client.overlay.Marker;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget;
import com.scoutmobmap.shared.OfferDto;

public class OfferMarker extends Marker {
  public Date expiration;
  public Date start;
  public int numClaimed;
  public String id;
  public String vendorUrl;
  public String latlng;
  public String title;
  public String details;
  
  public OfferMarker(OfferDto dto) {
    super(LatLng.fromUrlValue(dto.latlng));
    this.expiration = dto.expiration;
    this.start = dto.start;
    this.numClaimed = dto.numClaimed;
    this.id = dto.id;
    this.vendorUrl = dto.vendorUrl;
    this.latlng = dto.latlng;
    this.title = dto.title;
    this.details = dto.details;
  }
  
  public Widget getInfoWindowWidget() {
    return new HTML(title + " <i>" + details + "</i>");
  }
}
